﻿#ifndef INFO_ITEM_H
#define INFO_ITEM_H

#include <QWidget>
#include <QMouseEvent>
#include <QResizeEvent>
#include <QDebug>

namespace Ui {
class Info_item;
}

class Info_item : public QWidget
{
    Q_OBJECT

public:
    explicit Info_item(QString email,QString username,QString newInfo,QString newDate,int width,QWidget *parent = nullptr);
    ~Info_item();
    void setNormalStyle();
    void setClickStyle();
    QString getEmail();
    void setNewInfo(QString newInfo,QString newDate);
    void updateHeadImg();
public slots:
    void resizeWidth(int width);
signals:
    void clicked(Info_item* item);
    void showComm(QString email,QString name,QString message);
protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseDoubleClickEvent(QMouseEvent* event);
    void resizeEvent(QResizeEvent *event);
private:
    Ui::Info_item *ui;
    QString email;
    QString username;
};

#endif // INFO_ITEM_H
